<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CaseView.aspx.cs" MasterPageFile="~/Main.master"
    Inherits="Liberty.UI.GrantManagement.CaseView" Title="Case Details" %>

<%@ Register TagPrefix="uc1" TagName="CaseEditView" Src="~/CaseManagement/Controls/CaseEditView.ascx" %>
<%@ Register TagPrefix="uc2" TagName="NewNoteView" Src="~/NoteManagement/Controls/NewNoteView.ascx" %>
<%@ Register TagPrefix="uc3" TagName="NoteListView" Src="~/NoteManagement/Controls/NoteListView.ascx" %>
<%@ Register TagPrefix="uc4" TagName="GrantSummaryView" Src="~/GrantManagement/Controls/GrantSummaryView.ascx" %>
<%@ Register TagPrefix="uc5" TagName="CaseDetailView" Src="~/CaseManagement/Controls/CaseDetailView.ascx" %>


<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="AJAXControls" %>
<%@ Register Assembly="Liberty.Controls" Namespace="Liberty.Controls.WebControls" TagPrefix="cc1" %>



<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript" src="../scripts/CaseEditView.js"></script> 

 <script type="text/javascript">
        var onAjaxPostBack = false;
        function UpdatePanel_BeginRequest( sender, args )
        {
            onAjaxPostBack = true;
        }
        
        function UpdatePanel_PageLoaded( sender, args )
        {
            if( validationRuleSet && onAjaxPostBack )
            {
                validationRuleSet.ReSubscribe();
            }
            onAjaxPostBack = false;
        }
       
        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest( UpdatePanel_BeginRequest );
        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded( UpdatePanel_PageLoaded );

    </script>

</div>
    <div class="PageContent">
        <table width="100%">
        
         <tr>
                <td style="width:67%;vertical-align:top;">
                    <div>
              <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                <td style="width: 100%">
                    <uc5:CaseDetailView ID="ucCaseDetailView" runat="server" />
                    <uc1:CaseEditView ID="ucCaseEditView" runat="server" Visible="false" />
                    <hr />
                    <br />
            
                    <br />
                 </td>
                 <td style="vertical-align:top;padding-top:10px;padding-right:5px">
                    <div class="ServiceMemberNavigation" style="vertical-align:top;">
                        <asp:Button ID="cmdEdit" runat="server"  OnClick="cmdEdit_Click" Text="Edit" />
                        
                    </div>
                 </td>
                 </tr>                   
               <tr>
                      <td colspan=2 style="vertical-align:top;padding-top:20px; padding-left:20px">   
                        <asp:Button ID="cmdSave" runat="server"  OnClick="cmdSave_Click" Text="Save" Visible="false" />
                        &nbsp;&nbsp; <asp:Button ID="cmdCancel" runat="server" CausesValidation="false" OnClick="cmdCancel_Click" Text="Cancel" Visible="false" />
                      </td>
                    </tr>
                </table>
                        <uc2:NewNoteView ID="ucNewNoteView" runat="server" />
                    <uc3:NoteListView ID="ucNoteListView" runat="server" />
                </div>        
                </td>
               
                <td style="width:1%">
                </td>      
                
                 <td class="VerticalPanel" style="width:32%;vertical-align:top; white-space:nowrap">
               
                <div id="GrantsSummaryView" style="width: 100%">
                        <asp:Panel ID="GrantsHeader" runat="server">
                            <div style="float: left; vertical-align: middle; white-space:nowrap">
                                Grants
                            </div>
                            <div style="float: right; vertical-align: middle; white-space:nowrap">
                                <asp:Label ID="lblToggleGrants" runat="server">(Hide Details...)</asp:Label>
                                <asp:ImageButton ID="cmdGrantPanel" runat="server" ImageUrl="~/App_Themes/IMSFF/Images/collapse.jpg" />
                            </div>
                        </asp:Panel>
                        <div style="width:100%">
                            <asp:Panel ID="GrantsBody" runat="server">
                             <uc4:GrantSummaryView ID="ucGrantSummaryView" runat="server" />     
                                                         
                            </asp:Panel>
                        </div>
                        <AJAXControls:CollapsiblePanelExtender 
                            ID="GrantsPanel"
                            RunAt="server" 
                            TextLabelID="lblToggleGrants"
                            ImageControlID="cmdGrantPanel" 
                            TargetControlID="GrantsBody" 
                            CollapseControlID="GrantsHeader"
                            ExpandControlID="GrantsHeader" >
                        </AJAXControls:CollapsiblePanelExtender>
                    </div>
                  
              </td>
        </table>
    </div>
    
     <cc1:PageValidator ID="PageValidator1" runat="server" PostbackControl="cmdSave" />
</asp:Content>
